package cn.lingyangwl.agile.member.controller.admin;

import cn.lingyangwl.agile.member.model.rqrs.account_detail.AccountDetailPageReq;
import cn.lingyangwl.agile.member.model.rqrs.account_detail.AccountDetailResp;
import cn.lingyangwl.agile.member.service.AccountDetailService;
import cn.lingyangwl.agile.ram.ActionType;
import cn.lingyangwl.agile.ram.RamResource;
import cn.lingyangwl.framework.core.response.Resp;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 账户明细
 * 
 * @author shenguangyang
 */
@Api(tags = "账户明细")
@RestController
@RequestMapping("/accountDetail")
public class AccountDetailController {
    @Resource
    private AccountDetailService accountDetailService;

    @ApiOperation(value = "分页账户明细")
    @GetMapping("/page")
    @RamResource(action = "member:accountDetail:query", name = "查询账户明细", type = ActionType.READ)
    public Resp<IPage<AccountDetailResp>> pageAccountDetail(@Validated AccountDetailPageReq req) {
        return Resp.ok(accountDetailService.pageAccountDetail(req));
    }
}
